#ifndef FORM_XMDZ_H
#define FORM_XMDZ_H

#include <QWidget>
#include <QSqlQuery>
#include <QSqlError>
#include "threadyb.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkInterface>
#include <QNetworkRequest>
#include <QJsonObject>
#include <QJsonArray>
#include <QListWidgetItem>
#include <QTimer>

namespace Ui {
class Form_xmdz;
}

class Form_xmdz : public QWidget
{
    Q_OBJECT

public:
    explicit Form_xmdz(QWidget *parent = nullptr);
    ~Form_xmdz();

    void display(QString ); //刷新当前界面显示
    void putBaseIn( QJsonObject &in, QString code);
    //void center_query();

private slots:
    void closeEvent(QCloseEvent *event);
    void on_pbExit_clicked();
    void on_pbCompare_clicked();
    void on_pbUncompare_clicked();
    void on_cbbList_curIndChanged(int);
    void on_leSearch_returnPressed();
    void on_tvDisplay_doubleClicked(const QModelIndex &index);
    void on_leSearch_textChanged(QString);
    void on_pbMlcx_clicked();

    void on_rbLocal_clicked();
    void on_rbCenter_clicked();
    void on_rbCompared_clicked();

    void onTimeOut();
    void on_pbTest_clicked();

    void postRequestFinished(QNetworkReply *);

private:
    Ui::Form_xmdz *ui;
    QSqlQuery *qro;
    QSqlQuery *qrm;
    QString sq;

    QTimer *tm;

    QNetworkRequest request;
    //QNetworkAccessManager* naManager;
    QNetworkAccessManager  naaManager0;
    QNetworkReply * rpl ;

    //volatile bool businessFinish;    //医保交易完成标志
    //bool businessSuccess;       //医保交易成功标志
    QString list_type; //目录类别
    QSqlQueryModel mdList;
    bool httpSuccess;
    volatile bool httpFinished;
    QString localID, centerID;  //用于对照的本地码和中心码
    QString med_chrgitm_type;   //项目收费类别
    QString hilist_name, chrgitm_lv, lmt_used_flag, med_use_flag, hilist_use_type,pinyin;
    QString item_name;
    QString currentInfno;//
    QString currentMsgid;

    bool windInitialed;
    bool allPriv;// 权限标志
};

#endif // FORM_XMDZ_H
